fix: HWPX 업로드 실제 파일 구조 검증 (ZIP·mimetype·section0.xml) - #110
Merged
Conversation
chaeliki
marked this pull request as ready for review
August 7, 2026 07:16
hywznn
reviewed
Aug 7, 2026
Contributor
|
이젠 저 부분 client에서 어떻게 연결될지를 생각하면 될 것 같네요 짱이십니다 |
hywznn
approved these changes
Aug 7, 2026
10 tasks
10 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
왜 필요한가요?
Closes #109
#80(PR #91) 리뷰에서 발견된 문제입니다. HWP는 OLE 시그니처까지 검증하는데,
HWPX는 요청 MIME이 application/hwp+zip이면 실제 파일 구조와 무관하게
허용하고 있었습니다. Agent(문서 초안 작성) 쪽은 이미 실제 ZIP을 열어서
내부 mimetype과 Contents/section0.xml 존재 여부를 확인하고 있어, Server와
검증 수준이 불일치했습니다.
완료된 범위
application/hwp+zip 제거 (문자열 MIME 비교로 우회 가능했던 경로 차단)
결정 사항
파일에 이 MIME을 붙여서 화이트리스트를 우회할 수 있는 경로가 있었고,
이제 .hwpx는 항상 시그니처 검증을 거칩니다.
실제 내용만으로 판단합니다.
어떻게 검증했나요?
section0.xml 없음, ZIP 아님, 빈 파일, 대체 section 번호)
매핑되는 것을 코드로 직접 재확인
참고